Negative time points are always out of bound in track filter.
authorrobertl <robertl>
Sun, 20 Jun 2010 00:03:31 +0000 (00:03 +0000)
committerrobertl <robertl>
Sun, 20 Jun 2010 00:03:31 +0000 (00:03 +0000)
trackfilter.c

index b5d2e2b2da89ef4ddee51e62988daec135704975..1e47ec3bf88240b30c5e3c188c7138b35d4bf1b3 100644 (file)
@@ -864,10 +864,14 @@ trackfilter_range(void)           /* returns number of track points left after filtering
            QUEUE_FOR_EACH((queue *)&track->waypoint_list, elem, tmp)
            {
                waypoint *wpt = (waypoint *)elem;
-
                if (wpt->creation_time > 0) {
                    inside = ((wpt->creation_time >= start) && (wpt->creation_time <= stop));
                }
+               // If the time is mangled so horribly that it's 
+               // negative, toss it.
+               if (wpt->creation_time < 0) {
+                   inside = 0;
+               }
                
                if (! inside) {
                    track_del_wpt(track, wpt);